home *** CD-ROM | disk | FTP | other *** search
- // Copyright 1994 by Jon Dart. All Rights Reserved.
- #ifndef _CHESS_H
- #define _CHESS_H
-
- #include <wpmain.h>
- #include "board.h"
- #include "options.h"
- #include "search.h"
- #include "srclimit.h"
- #include "timectrl.h"
- #include "log.h"
- #include "book.h"
- #include "clock.h"
- #include "rmove.h"
- #include <wpglob.h>
- #include <time.h>
-
- class Display;
-
- APPCLASS Chess : public WPMainWin
- {
- // main application window.
-
- public:
- Chess();
- virtual ~Chess();
- void paint(WPPaintStruct &ps);
- BOOL mouse( int msg, WPPoint p, WORD flags );
- BOOL menuInit(WPMenu &menu);
- BOOL command( int id, WORD msg );
- BOOL timer(int id);
- BOOL sized(WPRect &box, WORD how);
- ColorType side_to_move() const
- {
- return current_board.Side();
- }
-
- void write_log(char *msg);
- private:
- void reset();
- void compute_move(Board &board, const Time_Info &ti,
- const Boolean background, Search::Statistics &stats,
- ExtendedMove &emove);
- void update_board(const ExtendedMove &emove,
- const Search::Statistics *stats,
- const Boolean update_log);
-
- void draw_board();
-
- void show_side();
-
- void show_last_move();
-
- void show_last_move( char *move_image );
-
- void computer_plays( const ColorType side );
-
- void setup_clock( const ColorType side);
- void setup_clock_initially();
-
- void update_time();
-
- Board current_board;
- Log log;
- Display *display;
- Search *searcher;
- Search_Limit_Options options;
- Search::Statistics stats;
- Time_Control tc[Max_Time_Controls]; // Time limits
- Time_Info ti[2]; // Holds current time control for each side
- Square start_square; // for move
- ReversibleMove last_move;
- ExtendedMove predicted_move;
- char last_move_image[12];
- Boolean searching;
- Boolean users_move;
- Boolean use_book;
- Boolean no_prev_search;
- Boolean quitting;
- int last_cmd;
- ColorType computer_side;
- };
-
- #endif
-